In network devices, including, for example, routers, switches or integrated security service gateway systems, packets travel through multiple service cards (e.g., security service cards or input/output (I/O) line cards) while being processed. Ingress I/O cards of the multiple service cards are the first service cards in the network device and egress I/O cards of the multiple service cards are the last service cards in the network device. Hierarchical class-based queuing may be implemented in the individual service cards to enforce quality of service constraints on packet traffic handled by the service cards. Weight-based packet schedulers are commonly used in scheduling packet queuing/dequeuing in such service cards.
Weight-based packet schedulers schedule packets for each of the queues based on a configured weight regardless of traffic conditions in downstream service cards. Some typical weight-based scheduling algorithms may not work well under a number of conditions, including when the size of a packet changes in different service cards because of compression/decompression or encryption/decryption or when the time needed to process packets of a traffic class is different in different service cards. As a result, queues at downstream service cards that employ existing weight-based scheduling algorithms may be handling too many packets, while the upstream service card continues to schedule and process packets that will be sent to these downstream queues. However, at the same time, other queues in a downstream service card may be empty while the upstream service card does not process, or slowly processes, packets destined for these other queues.